package com.myqf.demo.反射.bz案例;

import lombok.Data;

@Data
public class Person {

	private String name = "person";

	public int age = 0;

	public Person() {
		System.out.println("     Person默认构造方法");
	}

	public Person(String name, int age) {
		this.name = name;
		this.age = age;
		System.out.println("     Person带参数的构造方法");
	}

  	private void print() {
		System.out.println("     Person print() ");
	}

	public void print(String test) {
		System.out.println("     Person print(String) " + test);
	}

	public void print(int test) {
		System.out.println("     Person print(int) " + test);
	}
}

/**
 * 子类
 */
@Data
class Student extends Person {

	private int score = 0;

	public Student() {
		System.out.println("     Student默认的构造方法");
	}

	private Student(String name) {
		System.out.println("     Student带参数的构造方法"+name);
	}

	private void print(double num) {
		System.out.println("     Student print(double) " + num);
	}
}
